package view.component.monster.large_monster
{
	import enums.main.UISize;
	
	import feathers.controls.Screen;
	import feathers.controls.ScrollContainer;
	import feathers.controls.Scroller;
	
	import view.component.IAnimateNaviView;
	
	/**
	 * 大型怪物详细-视频收藏界面
	 * @author £iang
	 * 
	 */	
	public class LMDetailVideoView extends Screen implements IAnimateNaviView
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		/** 滚动条切换容器 */
		public var videoSC:ScrollContainer;
		/** 列表界面 */
		public var listView:LMVideoListView;
		/** 编辑界面 */
		public var editView:LMVideoEditView;
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		/**
		 * 初始化函数 
		 * 
		 */		
		override protected function initialize():void
		{
			videoSC = new ScrollContainer();
			videoSC.scrollerProperties.hasElasticEdges = false;
			videoSC.scrollerProperties.snapToPages = true;
			videoSC.scrollerProperties.throwEase = "easeOut";
			videoSC.scrollerProperties.interactionMode = 
				Scroller.INTERACTION_MODE_MOUSE;
			videoSC.scrollerProperties.scrollBarDisplayMode = 
				Scroller.SCROLL_BAR_DISPLAY_MODE_NONE;
			videoSC.width = UISize.MAIN_W;
			videoSC.height = UISize.MAIN_H - 
				( UISize.MONSTER_TAB_AREA_H + 
					UISize.LMONSTER_DETAIL_TAB_AREA_H ) * this.dpiScale;
			
			this.addChild( videoSC );
			
			listView = new LMVideoListView();
			listView.width = UISize.MAIN_W;
			videoSC.addChild( listView );
			editView = new LMVideoEditView();
			editView.width = UISize.MAIN_W;
			videoSC.addChild( editView );
		}
		
		/**
		 * 调整位置大小 
		 * 
		 */		
		override protected function draw():void
		{
			editView.x = UISize.MAIN_W;
		}
		
		/**
		 * 隐藏动画
		 * 
		 */		
		public function playHideAnimate():void
		{
			if ( videoSC.horizontalPageIndex == 0 )
			{
				listView.playHideAnimate();
			}
			else
			{
				editView.playHideAnimation();
			}
		}
		
		/**
		 * 显示动画
		 * 
		 */		
		public function playShowAnimate():void
		{
			listView.playShowAnimate();
		}
		
		
		/**
		 * 改变滚动条容器页面 
		 * @param newPage 新页面
		 * 
		 */		
		public function changeSCPageIndex( newPage:int ):void
		{
			videoSC.scrollToPageIndex( newPage, 0, 0.4 );	
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		/**
		 * 析构函数 
		 * 
		 */		
		override public function dispose():void
		{
			super.dispose();
		}
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function LMDetailVideoView()
		{
		}
	}
}